package sysu.el.graph.undi.analysis;

import sysu.el.array.algors.MaxElem;
import sysu.el.graph.undi.UndiDCG;
import sysu.el.graph.undi.UndiGT;
import sysu.el.graph.undi.UndiGTInterface;

/**
 * The graph analysis is based on the dcg.
 * @author Edwin Lee
 */

public class UndiGTAnalysis {
	public UndiGTInterface graph;
	public UndiDCG undiDCG;
	public UndiGTAnalysis(UndiGTInterface graph, UndiDCG undiDCG){
		this.graph = graph;
		this.undiDCG = undiDCG;
	}
	
	public UndiGTAnalysis(UndiGT graph){
		this.graph = graph;
		this.undiDCG = new UndiDCG(graph.weight);
	}
	
	public int graphDiameter;
	public int calGraphDiameter(){
		this.graphDiameter = 0;
		for (int /*i=0*/i=1; i<undiDCG.getNodeNum(); i++)
			this.graphDiameter = MaxElem.Int(i, undiDCG.w[i], this.graphDiameter);
		return graphDiameter;
	}
	
}
